package de.unistuttgart.iaas.interaction.mail.util;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;


public class LoggingFileHandler
{
	public String strFile = "";
	
	FileInputStream propInFile = null;
	
	public Properties config = new Properties();
	public static LoggingFileHandler logFileHandler = null;
	

	static String MailLogFileSize = "MailLogFileSize";
	static String MailLogLevel = "MailLogLevel";
	static String MailPattern = "MailPattern";
	static String GetRequestLogFilePath = "GetRequestLogFilePath";
	static String ReceiveMailLogFilePath = "ReceiveMailLogFilePath";
	static String SendMailLogFilePath = "SendMailLogFilePath";
	static String RegisterLogFilePath = "RegisterLogFilePath";
	static String ProcessMailLogFilePath = "ProcessMailLogFilePath";
	static String GetResponseLogFilePath = "GetResponseLogFilePath";
	static String MailLayout = "MailLayout";	
	static String MailAppender = "MailAppender";
	static String MailMaxBackupIndex = "MailMaxBackupIndex";
	

	public LoggingFileHandler(String strFile)
	{
		try
		{
			propInFile = new FileInputStream(strFile);
			config.load(propInFile);
		}
		catch(IOException exLogConfigError)
		{
			System.out.println("The file " + strFile + " cann't be opened!");
			exLogConfigError.printStackTrace();
		}
	}

	public String getGetResponseLogFilePath()
	{
		return config.getProperty(GetResponseLogFilePath);
	}
	public String getGetRequestLogFilePath()
	{
		return config.getProperty(GetRequestLogFilePath);
	}	
	public String getReceiveMailLogFilePath()
	{
		return config.getProperty(ReceiveMailLogFilePath);
	}
	public String getSendMailLogFilePath()
	{
		return config.getProperty(SendMailLogFilePath);
	}
	public String getRegisterLogFilePath()
	{
		return config.getProperty(RegisterLogFilePath);
	}
	public String getProcessMailLogFilePath()
	{
		return config.getProperty(ProcessMailLogFilePath);
	}
	
	
	public String getMailLogFileSize()
	{
		return config.getProperty(MailLogFileSize);
	}
	
	
	public String getMailLogLevel()
	{
		return config.getProperty(MailLogLevel);
	}
	
	public String getMailPattern()
	{
		return config.getProperty(MailPattern);
	}
	
	
	public String getMailLayout()
	{
		return config.getProperty(MailLayout);
	}
	public String getMailAppender()
	{
		return config.getProperty(MailAppender);
	}
	public String getMailMaxBackupIndex()
	{
		return config.getProperty(MailMaxBackupIndex);
	}
	

}
